<link rel="stylesheet" href="/Template/pc/kty/Static/css/index.css" type="text/css">
<link rel="stylesheet" href="/Template/pc/kty/Static/css/stylecm.css" type="text/css">

<script src="/Public/js/jquery-1.10.2.min.js"></script>
<script src="/Public/js/global.js"></script>
<script src="/Public/js/base.js"></script>
<script src="/Public/js/pc_common.js"></script>
<script src="/Public/js/layer/layer.js"></script>
<script src="/Public/js/jquery.jqzoom.js"></script>
<script src="/Public/js/jqueryUrlGet.js"></script><!--获取get参数插件-->
<!--弹窗js 参考文档 http://layer.layui.com/-->

<!--最顶部-->
<div class="site-topbar">
    <div class="layout">
        <div class="navlft">
         <p>开太鱼文化，您身边的食疗专家</p>
            <ul>
                <li><a href="{:U('Home/user/login')}">请登录</a></li>
                <li class="s1k">|</li>
                <li><a href="{:U('Home/user/reg')}">快速注册</a></li>
            </ul>
        </div>
        <div class="navrt">
            <li><a href="{:U('Home/User/order_list')}">我的订单</a></li>
            <li class="s1k s2k">|</li>
            <li><a href="{:U('Home/User/index')}">会员中心</a></li>
            <li class="s1k s2k">|</li>
            <li><a href="javascript:AddFavorite('{$tpshop_config['shop_info_store_title']}', 'http://www.kaitaiyu.com');">加入收藏</a></li>
            <li class="s1k s2k">|</li>
            <!-- JiaThis Button BEGIN -->
            <li><a href="">乐于分享：</a></li>
            <li><a href="javascript:;" class="jiathis_button_qzone"><img src="/Public/images/scqq.png" alt=""/></a></li>
            <li><a href="javascript:;" class="jiathis_button_weixin"><img src="/Public/images/scwx.png" alt=""/></a></li>
            <!-- JiaThis Button BEGIN --> 
            <script "text/javascript"> 
            var jiathis_config = { 
                  title: "开太鱼文化", 
                  summary:"您身边的食疗专家",
                  pic:"http://ykty.yanshuju.com/Public/images/logo.png",
            } 
            </script>
            <!-- JiaThis Button END -->
            <script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
            <!-- JiaThis Button END -->
        </div>
    </div>
</div>

<!--顶部banner开始-->    
<!--顶部banner结束-->    

<header>
    
    <div class="layout">
    
    <!--logo开始-->
        <div class="logo"><a href="/" title="开太鱼文化"><img width="240" src="/Public/images/logo.png" alt="开太鱼文化"></a></div>
    <!--logo结束-->
    
    <!-- 搜索开始-->
        <div class="searchBar">
            <div class="searchBar-form">

                <form name="sourch_form" id="sourch_form" method="post" action="/Home/Goods/search.html">
                    <img src="/Public/images/search.png" alt=""/>
                    <input type="text" class="text" name="q" id="q" value="{:I('q')}"  placeholder="搜索"/>
                    <input type="button" class="button" value="搜索" onclick="if($.trim($('#q').val()) != '') $('#sourch_form').submit();"/>
                <input type="hidden" name="__hash__" value="6666cd76f96956469e7be39d750cc7d9_2a40c9712823b281a14ee01602fc559d" /></form>
            </div>
        </div>
        <!-- 搜索结束-->

        <div class="shopping11">
            <img src="/Public/images/shopping.png" alt=""/>
            <span id="cart_quantity">0</span>
            <div class="shoppingjs">
            </div>
        </div>


    </div>
</header>
   <!-- 导航-开始-->


    <div class="navigation">
        <div class="layout">
            <!--全部商品-开始-->
            <div class="allgoods">
                <div class="goods_num"><o class="xiabiao"></o><h2>商品分类</h2><i class="trinagle"></i></div>
                <div class="list" <?php if(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME == 'Home/Index/index') echo 'style="display:block;"'; ?>>
                    <ul class="list_ul">
                        <foreach name="goods_category_tree" key="k" item='v'>
                            <li class="list-li">
                                <div class="list_a">
                                        <img class="aimg1" width="43" height="43" src="{$v['image']}" alt=""/>
                                        <p style="min-width: 64px; text-align: left;">
                                            <a href="{:U('Home/Goods/goodsList',array('id'=>$v[id]))}">{$v['name']}</a>
                                        </p>
                                        <img class="aimg2" src="/Public/images/jiantou.png" alt=""/>
                                </div>
                                <div class="list_b">
                                    <div class="mg20"></div>
                                    <foreach name="v[tmenu]" item="v2" key="k2" >
                                        <div class="bk">
                                            <h3><a href="{:U('Home/Goods/goodsList',array('id'=>$v2[id]))}">{$v2['name']}</a></h3>
                                            <div class="leikuang">
                                                <foreach name="v2[sub_menu]" item="v3" key="k3" >
                                                    <a href="{:U('Home/Goods/goodsList',array('id'=>$v3[id]))}">{$v3['name']}</a>
                                                </foreach>
                                            </div>
                                        </div>
                                    </foreach>
                                </div>
                            </li>
                        </foreach>
                    </ul>
                </div>
            </div>
            <!--全部商品-结束-->

            <div class="ongoods">
                <ul class="navlist">
                    <li class="homepage"><a href="/">首页</a></li>
                    <tpshop sql="SELECT * FROM `__PREFIX__navigation` where is_show = 1 ORDER BY `sort` DESC" key="k" item='v'>
                        <li class="page"><a href="{$v[url]}" <if condition="$v[is_new] eq 1">target="_blank" </if>>{$v[name]}</a></li>
                    </tpshop>
                </ul>
            </div>
        </div>
    </div>
   <!-- 导航-结束-->


    <script>
    set_first_leader(); //设置推荐人 
    // 如果是手机浏览器跳到手机
    if(isMobileBrowser())
       location.href="/Mobile/Index/index.html";


    get_cart_num();
    function get_cart_num(){
          var cart_cn = getCookie('cn');
          if(cart_cn == ''){
            $.ajax({
                type : "GET",
                url:"/index.php?m=Home&c=Cart&a=header_cart_list",//+tab,
                success: function(data){                                 
                    cart_cn = getCookie('cn');      
                    $('#cart_quantity').html(cart_cn);
                }
            });
          }
          $('#cart_quantity').html(cart_cn);
    }
    /**
    * 鼠标移动端到头部购物车上面 就ajax 加载
    */
    // 鼠标是否移动到了上方
    var header_cart_list_over = 0;
    $(".shopping11 img").hover(function(){    
        console.log(1);
       if(header_cart_list_over == 1) 
            return false;   
        header_cart_list_over = 1; 
        $.ajax({
            type : "GET",
            url:"/index.php?m=Home&c=Cart&a=header_cart_list",//+tab,
            success: function(data){                                 
                $(".shopping11 .shoppingjs").html(data); 
                get_cart_num();
            }
        });
    }).mouseout(function(){
        
         (typeof(t) == "undefined") || clearTimeout(t);      
         t = setTimeout(function () { 
                header_cart_list_over = 0; /// 标识鼠标已经离开
            }, 1000);       
    });
    </script>